package com.AAA.controllor;

import com.AAA.entity.Info;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class testControllor {

    @RequestMapping("checkUserName")
    public String ioFile(String name){
        System.out.println(name);
    if (name.equals("zs")){
        return "0";
    }else {
        return "1";
    }

    }

    @PostMapping("login")
    public String login(String name,String password){
        System.out.println("name="+name+"password="+password);
        return "1";
    }

    @GetMapping("queryall")
    public List<Info> queryAll(){
        List<Info> list=new ArrayList<>();
        for (int i=0;i<5;i++){
            Info info=new Info();
            info.setName("test"+i);
            info.setPassword("123456");
            list.add(info);
        }
        return list;
    }
}
